package com.zj.core.activity

import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import com.systemutils.SoftKeyboardUtils
import com.dialogutils.ToastUtil
import com.quitutils.SwipeBackLayout
import com.zj.core.R
import com.zj.core.base.TitleBarActivity
import com.zj.core.ui.RefuseActivityUi
import org.jetbrains.anko.setContentView

class RefuseActivity: TitleBarActivity(),View.OnClickListener{
    lateinit var view: RefuseActivityUi

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setQuitMode(SwipeBackLayout.EDGE_LEFT)
    }

    override fun onCreate(groupView: LinearLayout): View? {
        view= RefuseActivityUi(groupView)
        return view.setContentView(this)
    }

    override fun initView(){
        setTitleText("反馈")
        view.commit_text_tv.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        super.onClick(v)
        when(v?.id){
           R.id.commit_text_tv->{

               view.details_input_tv.text?.let {
                   if (SoftKeyboardUtils.isSoftShowing(this)) {
                       SoftKeyboardUtils.hideSystemSoftKeyboard(this,currentFocus.windowToken)
                   }else{
                       finish()
                   }
               }?:let {
                   ToastUtil.showShort(this,"提交数据为空")
               }
           }
        }
    }
}